package com.seelyn.ddvideo.spider;

/**
 * @author ifcousing-linfeng
 * @since 2017/6/23
 */
public enum MovieSubTypeEnum {

    DONGZUOPIAN("动作片"), XIJUPIAN("喜剧片"), AIQINGPIAN("爱情片"), KEHUANPIAN("科幻片"),
    KONGBUPIAN("恐怖片"), ZHANZHENGPIAN("战争片"), JUQINGPIAN("剧情片"), LUNLIPIAN("伦理片"),
    WEIDIANYING("微电影"), FULIPIAN("福利片"), GUOCHANJU("国产剧"), GANGTAIJU("港台剧,香港剧,台湾剧"), RIHANJU("日韩剧,日本剧,韩国剧"), OUMEIJU("欧美剧"), DONGMAN("动漫");

    private String value;

    MovieSubTypeEnum(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static MovieSubTypeEnum getEnum(String value) {
        for (MovieSubTypeEnum typeEnum : values()) {
            if (typeEnum.getValue().contains(value)) {
                return typeEnum;
            }
        }
        return DONGZUOPIAN;
    }

    public static String getVal(int index) {
        for (MovieSubTypeEnum typeEnum : values()) {
            if (typeEnum.ordinal() == index) {
                return typeEnum.value;
            }
        }
        return "";
    }

}
